﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage/Admin.Master"
    CodeBehind="Recommend.aspx.vb" Inherits="GoodAnotApp.AddShopOutlets" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #TextArea1
        {
            height: 81px;
            width: 491px;
        }
        #txtADetails
        {
            height: 70px;
            width: 407px;
        }
        #tbxShopURL
        {
        }
        .style6
        {
            width: 906px;
        }
        #Text5
        {
            height: 24px;
            width: 451px;
        }
        #tbxShopOutletAddress
        {
            height: 28px;
            width: 368px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopAddress
        {
            width: 337px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopAddress0
        {
            width: 337px;
        }
        #tbxShopOutletAddress0
        {
            height: 28px;
            width: 368px;
        }
        
        
        #NewExsistingBusiness
        {
            width: 427px;
        }
        .style7
        {
            width: 351px;
        }
        .style8
        {
            width: 739px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="AdShop&Outlets" style="top: 300px; margin-left: 10px; width: 945px;">
        <table style="width: 100%" id="AddShopOutletsTable">
            <tr>
                <td class="NewExsistingBusiness" style="border-top: 0px">
                    <asp:RadioButtonList ID="rblBusinessType" runat="server" AutoPostBack="True" Width="397px"
                        BorderWidth="3px" BorderColor="Black">
                        <asp:ListItem Value="1" Text="New Business" />
                        <asp:ListItem Value="0" Text="Exsisting Business" />
                    </asp:RadioButtonList>
                    <br />
                    <br />
                    &nbsp;&nbsp;&nbsp;
                    <asp:Panel ID="SearchPanel" runat="server" Visible="False">
                        <asp:TextBox ID="tbxSearch" runat="server"></asp:TextBox>
                        &nbsp;&nbsp;&nbsp;
                        <asp:Button ID="btnSearch" runat="server" Text="Search" />
                    </asp:Panel>
                </td>
                <td class="style6">
                    <asp:Panel ID="BusinessDetailPanel" runat="server" Width="500px">
                        <table style="width: 50%; height: 181px;" width="500px">
                            <tr>
                                <td class="style23">
                                    Business Name :
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxBusinessName" runat="server" Width="374px"></asp:TextBox>
                                    &nbsp;&nbsp;
                                    <asp:Label ID="lblBusinessNameValidator" runat="server" Text="Please kindly key in the business name"
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="style23">
                                    Category:
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlCategory" runat="server">
                                        <asp:ListItem>--Select Category--</asp:ListItem>
                                        <asp:ListItem>Retail</asp:ListItem>
                                        <asp:ListItem>Fashion &amp; Clothing</asp:ListItem>
                                        <asp:ListItem>Beauty &amp; Sports</asp:ListItem>
                                        <asp:ListItem>Home &amp; Electronics</asp:ListItem>
                                        <asp:ListItem>Entertainment</asp:ListItem>
                                        <asp:ListItem>Night Clubs</asp:ListItem>
                                        <asp:ListItem>Gaming </asp:ListItem>
                                        <asp:ListItem>Cinema</asp:ListItem>
                                        <asp:ListItem>Arts</asp:ListItem>
                                        <asp:ListItem>Education</asp:ListItem>
                                        <asp:ListItem>Tuition Centre</asp:ListItem>
                                        <asp:ListItem>Enrichment Classes</asp:ListItem>
                                        <asp:ListItem>Health &amp; Beauty</asp:ListItem>
                                        <asp:ListItem>Doctors</asp:ListItem>
                                        <asp:ListItem>Dentists</asp:ListItem>
                                        <asp:ListItem>Hospitals</asp:ListItem>
                                        <asp:ListItem>Clinics</asp:ListItem>
                                        <asp:ListItem>Medical Spa / Spa</asp:ListItem>
                                        <asp:ListItem>Massage</asp:ListItem>
                                        <asp:ListItem>Makeup Artists</asp:ListItem>
                                        <asp:ListItem>Pets</asp:ListItem>
                                        <asp:ListItem>Pet Accessories</asp:ListItem>
                                        <asp:ListItem>Veterinarians</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblCategoryValidator" runat="server" Text="Please kindly select a category"
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="style23">
                                    Website :
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxShopURL" runat="server" Width="376px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style23">
                                    Details :
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxShopDetails" runat="server" Width="394px" Height="102px" TextMode="MultiLine"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style23">
                                    Image :
                                </td>
                                <td>
                                    &nbsp;
                                    <asp:FileUpload ID="fileuploadImage" runat="server" />
                                    <asp:Button ID="btnUpload" runat="server" Text="Upload" />
                                </td>
                            </tr>
                            <tr align="right">
                                <td align="right" class="style18" colspan="2">
                                    <asp:Panel ID="PanelDone" runat="server" Height="30px" Width="65px">
                                        <asp:Button ID="BusinessDone" runat="server" Height="34px" Text="Done" Width="62px" />
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <br />
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hfImageID" runat="server" />
        <table style="width: 100%" width="715px">
            <tr>
                <td style="border-top: 0px" class="style8">
                    <asp:Panel ID="SearchResultPanel" runat="server" Visible="False">
                        <asp:ListView ID="SearchResult" runat="server" DataSourceID="SqlDataSourceSearchResults"
                            DataKeyNames="business_ID">
                            <EditItemTemplate>
                                <span style="">name:
                                    <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                                    <br />
                                    website:
                                    <asp:TextBox ID="websiteTextBox" runat="server" Text='<%# Bind("website") %>' />
                                    <br />
                                    details:
                                    <asp:TextBox ID="detailsTextBox" runat="server" Text='<%# Bind("details") %>' />
                                    <br />
                                    <asp:Label ID="business_IDLabel1" runat="server" Text='<%# Eval("business_ID") %>'
                                        Visible="False" />
                                    <br />
                                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                    <br />
                                    <br />
                                </span>
                            </EditItemTemplate>
                            <EmptyDataTemplate>
                                <span>No data was returned.</span>
                            </EmptyDataTemplate>
                            <InsertItemTemplate>
                                <span style="">name:
                                    <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                                    <br />
                                    website:
                                    <asp:TextBox ID="websiteTextBox" runat="server" Text='<%# Bind("website") %>' />
                                    <br />
                                    details:
                                    <asp:TextBox ID="detailsTextBox" runat="server" Text='<%# Bind("details") %>' />
                                    <br />
                                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                                    <br />
                                    <br />
                                </span>
                            </InsertItemTemplate>
                            <ItemTemplate>
                                <table border="0" width="100%">
                                    <tr>
                                        <td height="35px" style="font-size: 1.5em; font-weight: bold">
                                            <asp:LinkButton ID="lbname" runat="server" CommandArgument='<%# Eval("business_ID") %>'
                                                CommandName="selectBusiness">'<%# Eval("name") %>'</asp:LinkButton>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="35px">
                                            <asp:HyperLink ID="hlWebsite" runat="server" Text='<%# Eval("website") %>' NavigateUrl='<%# Eval("website") %>'></asp:HyperLink>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="35px">
                                            <asp:Label ID="BusinessDetails" runat="server" Text='<%# Eval("details") %>' />
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                            <LayoutTemplate>
                                <div id="itemPlaceholderContainer" runat="server" style="">
                                    <span runat="server" id="itemPlaceholder" />
                                </div>
                                <div style="">
                                </div>
                            </LayoutTemplate>
                            <SelectedItemTemplate>
                                <span style="">name:
                                    <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                                    <br />
                                    website:
                                    <asp:Label ID="websiteLabel" runat="server" Text='<%# Eval("website") %>' />
                                    <br />
                                    details:
                                    <asp:Label ID="detailsLabel" runat="server" Text='<%# Eval("details") %>' />
                                    <br />
                                    business_ID:
                                    <asp:Label ID="business_IDLabel" runat="server" Text='<%# Eval("business_ID") %>' />
                                    <br />
                                    <br />
                                </span>
                            </SelectedItemTemplate>
                        </asp:ListView>
                    </asp:Panel>
                </td>
                <td>
                    <div align="right">
                        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSourceDisplayOutletDetails"
                            AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"
                            Width="500px" ShowHeaderWhenEmpty="True">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                                <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                                <asp:BoundField DataField="Opening Hours" HeaderText="Opening Hours" SortExpression="Opening Hours" />
                                <asp:BoundField DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks" />
                                <asp:BoundField DataField="Phone No." HeaderText="Phone No." SortExpression="Phone No." />
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                        <asp:HiddenField ID="hfBusinessID" runat="server" />
                        <asp:SqlDataSource ID="SqlDataSourceDisplayOutletDetails" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                            
                            SelectCommand="SELECT outlet.name AS Name, outlet.address AS Address, outlet.opening_hours AS [Opening Hours], outlet.remarks AS Remarks, outlet.phone_no AS [Phone No.] FROM business INNER JOIN outlet ON business.business_ID = outlet.business_ID WHERE (outlet.business_ID = @business_ID)" 
                            ProviderName="System.Data.SqlClient">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="hfBusinessID" DefaultValue="" Name="business_ID"
                                    PropertyName="Value" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <table class="bordered-table" style="margin-bottom: 0px" width="500px">
                            <tr>
                                <td style="border-top: 0px" colspan="2">
                                    New outlet
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Outlet Name :
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxShopOutletName" runat="server" Width="300px"></asp:TextBox>
                                    <asp:Label ID="lblValidatorON" runat="server" Text="Please kindly key in the outlet name "
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Outlet Address:
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxOutletAddress" runat="server" Width="300px"></asp:TextBox>
                                    <asp:Label ID="lblValidatorOA" runat="server" Text="Please kindly key in the outlet address"
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Phone No:
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxShopOutletTel" runat="server" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Opening hours:
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxOpeningHours" runat="server" Width="300px"></asp:TextBox>
                                    <asp:Label ID="Label1" runat="server" Text="Please kindly key in the opening hours"
                                        Visible="False"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Remarks:
                                </td>
                                <td>
                                    <asp:TextBox ID="tbxRemarks" runat="server" Height="60px" TextMode="MultiLine" Width="300px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td align="right">
                                    <asp:Button ID="BtnDoneOD" runat="server" Text="Done" />
                                    &nbsp;&nbsp;
                                    <asp:Button ID="BtnAddMoreOutlets" runat="server" Text="Add More Outlets" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="style8">
                    <asp:SqlDataSource ID="SqlDataSourceSearchResults" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                        
                        SelectCommand="SELECT name, website, details, business_ID FROM business WHERE (name LIKE '%' + @search + '%')" 
                        ProviderName="System.Data.SqlClient">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="tbxSearch" DefaultValue="" Name="search" PropertyName="Text" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td class="style7">
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
